<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>船舶运营信息</title>
<base href="<%=basePath%>">

<link rel="stylesheet" href="static/ace/css/bootstrap.css" />
<link rel="stylesheet" href="static/ace/css/font-awesome.css" />
<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
<link rel="stylesheet" href="static/ace/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />


<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>


<!-- 日期框 -->
<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
<!-- 下拉框 -->
<script src="static/ace/js/chosen.jquery.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script>
//还原
function formReset()
{
document.getElementById("myForm").reset();
}
//新增
function shipadd(){
	
	 top.jzts();
    var diag = new top.Dialog();
    diag.Drag = true;
    diag.Title = "新增";
    diag.URL = '<%=basePath%>ship/shipadd';
    diag.Width = 600;
    diag.Height = 415;
    diag.CancelEvent = function () { //关闭事件
    	diag.close();
    	window.location.reload();	
    };
    diag.show();
	}
	//点击修改
function edit(){
	var id=$("input[type=checkbox]:checked").val();
	if(id==null){
		
		alert("请选择一条在修改")
	}else{
		
		top.jzts();
	     var diag = new top.Dialog();
	     diag.Drag = true;
	     diag.Title = "编辑";
	     diag.URL = '<%=basePath%>ship/edit?ID='+ id;
	     diag.Width = 600;
	     diag.Height = 415;
	     diag.CancelEvent = function () { //关闭事件
	     	diag.close();
	     	window.location.reload();	
	     };
	     diag.show();
		
		
	}
	
}
//点击可以计费
// function charging(){
// 	var id=$("input[type=checkbox]:checked").val();
	
// 	//var VAL=document.getElementById("tb").rows[1].cells[1]; 
// 	           // alert(VAL.innerHTML) 
	
	
// 	if(id==null){
		
// 		alert("请选择一条在修改")
// 	}else{
		//var bill =  $("#isBill").val();
	//	 var ob = obj;
	//	var tdobj = document.getElementById('tb');
		//alert(document.getElementById('isBill').value);
		
//	}
//}
</script>
</head>
<body>

	<div>

		<input type="button" value="新增" style="margin: 10px;" onclick="shipadd()"/> <input
			type="button" value="修改" style="margin: 10px;" onclick="edit()"/> <!--<input
 			type="button" value="可以计费" style="margin: 10px;" onclick="charging()"/> <input -->
<!-- 			type="button" value="撤销可以计费" style="margin: 10px;" /> -->

	</div>
	<form id="myForm">
		<table style="margin-top: 5px;">
			<tr>
				<td><label>运输工具：</label>
				<td style="vertical-align: top; padding-left: 2px;"><select
					class="chosen-select form-control" name="VEHICLE_TYPE"
					style="width: 120px;">
						<option value="">全部</option>
						<option value="0"
							<c:if test="${pd.VEHICLE_TYPE=='0' }">selected</c:if>>水运</option>

						<option value="1"
							<c:if test="${pd.VEHICLE_TYPE=='1' }">selected</c:if>>空运</option>
						<option value="2"
							<c:if test="${pd.VEHICLE_TYPE=='2' }">selected</c:if>>陆运</option>
						<option value="3"
							<c:if test="${pd.VEHICLE_TYPE=='3' }">selected</c:if>>铁运</option>

				</select></td>
				
				<td><label>船名：</label>
				<td style="vertical-align: top; padding-left: 2px;">
				<select
					class="chosen-select form-control" name="SHIP_NAME_ID"
					style="width: 120px;">
						<option value="">全部</option>
						<c:forEach items="${list1}" var="ship">
							<option value="${ship.SHIP_NAME }"
								<c:if test="${pd.SHIP_NAME_ID==ship.SHIP_NAME}">selected</c:if>>${ship.SHIP_NAME}</option>
						</c:forEach>

				</select></td>
				
				<td><label>航次：</label>
				<td style="vertical-align: top; padding-left: 2px;"><select
					class="chosen-select form-control" name="VOYAGE_NUMBER"
					style="width: 120px;">
						<option value="">全部</option>
						<c:forEach items="${list}" var="ship">
							<option value="${ship.VOYAGE_NUMBER }"
								<c:if test="${pd.VOYAGE_NUMBER==ship.VOYAGE_NUMBER}">selected</c:if>>${ship.VOYAGE_NUMBER }</option>
						</c:forEach>
				</select></td>
				</td>
				<td style="padding-left: 2px;"><label>计划开船日期:</label> <input type="text"
					class="span10 date-picker" name="SCHEDULED_SAILING_TIME"
					value="${pd.SCHEDULED_SAILING_TIME}" data-date-format="yyyy-mm-dd"
					readonly="readonly" style="width: 130px;" placeholder="计划开船结束日期"
					title="计划开船日期" /></td>
				<td style="padding-left: 2px;"><label>计划开船结束日期:</label> <input type="text"
					class="span10 date-picker" name="PLANNED_ARRIVAL_TIME"
					value="${pd.PLANNED_ARRIVAL_TIME}" data-date-format="yyyy-mm-dd" 
					readonly="readonly" style="width: 130px;" placeholder="计划开船结束日期" 
					title="最近登录结束" /></td>
				<td style="padding-left: 30px;"><input type="submit" value="查询" />
				</td>
				<td style="padding-left: 50px;"><input type="button" value="还原" onclick="formReset()"/>
				</td>
		</table>

	</form>
	<table class="table table-striped table-bordered table-hover" id="tb">
		<thead>
			<tr>
				<th class="center" style="width: 35px;"><label class="pos-rel"><input
						type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
				</th>
				<th class="center">运输方式</th>
				<th class="center">船名</th>
				<th class="center">航次</th>
				<th class="center">是否可以计费</th>
				<th class="center">是否满7天不能录入</th>
				<th class="center">航线</th>
				<th class="center">江船承运人</th>
				<th class="center">船舶起始地</th>
				<th class="center">船舶目的地</th>
				<th class="center">计划开船时间</th>
				<th class="center">计划结束时间</th>
				<th class="center">实际江船开航时间</th>
				<th class="center">实际江船到达时间</th>
				<th class="center">卸船完成时间</th>
				<th class="center">额定重箱</th>
				<th class="center">额定空箱</th>
				<th class="center">额定载重量</th>
				<th class="center">船舶挂港</th>

			</tr>
		</thead>
		<c:forEach items="${list}" var="ship">
			<tr>

				<td class='center' style="width: 30px;"><label><input
						type='checkbox'  value="${ship.ID}" /><span class="lbl"></span></label></td>
				<td class="center"><c:if test="${ship.VEHICLE_TYPE ==0}">
        		                                              水运
        </c:if> <c:if test="${ship.VEHICLE_TYPE ==1}">
        		                                               空运
        </c:if> <c:if test="${ship.VEHICLE_TYPE ==2}">
        		                                               陆运
        </c:if> <c:if test="${ship.VEHICLE_TYPE ==3}">
        		                                               铁运
        </c:if></td>
				<td class="center">${ship.SHIP_NAME }</td>
				<td class="center">${ship.VOYAGE_NUMBER }</td>
				<td id="q"  class="center"><c:if test="${ship.IS_BILLING ==1}">
        		                                               是
			        </c:if> 
			        <c:if test="${ship.IS_BILLING ==0}">
			                                                       否
			        </c:if>                             
               </td>
				<td class="center"><c:if test="${ship.IS_SEVEN_DAYS ==1}">
        		                                               是
        </c:if> <c:if test="${ship.IS_SEVEN_DAYS ==0}">
        		                                               否
        </c:if></td>
				<td class="center">${ship.ROUTE_NAME }</td>
				<td class="center"> ${ship.CARRIER }</td>
				<td class="center">${ship.STARTING_PLACE }</td>
				<td class="center">${ship.DESTINATION }</td>
				<td class="center">${ship.SCHEDULED_SAILING_TIME }</td>
				<td class="center">${ship.PLANNED_ARRIVAL_TIME }</td>
				<td class="center">${ship.ACTUAL_SAILING_TIME_VESSEL}</td>
				<td class="center">${ship.ACTUAL_ARRIVED_TIME}</td>
				<td class="center">${ship.SHIP_COMPLETION_TIME}</td>
				<td class="center">${ship.PALOAD_VOLUME}</td>
				<td class="center">${ship.EMPTY_CAPACITY}</td>
				<td class="center">${ship.WEIGHT}</td>
				<td class="center">${ship.CALL_PORT}</td>
			</tr>
		</c:forEach>


	</table>

</body>
<script type="text/javascript">
	$(top.hangge());
	//日期框
	$('.date-picker').datepicker({
		autoclose : true,
		todayHighlight : true
	});
</script>
</html>